config := meta.(*Config)

userAgent, err := generateUserAgentString(d, config.userAgent)
if err != nil {
  return nil, err
}

if v, ok := res["authEnabled"].(bool); ok {
	if v {
		url, err := replaceVars(d, config, "{{RedisBasePath}}projects/{{project}}/locations/{{region}}/instances/{{name}}/authString")
		if err != nil {
			return nil, err
		}

		billingProject := ""

		project, err := getProject(d, config)
		if err != nil {
			return nil, fmt.Errorf("Error fetching project for Instance: %s", err)
		}

		billingProject = project

		// err == nil indicates that the billing_project value was found
		if bp, err := getBillingProject(d, config); err == nil {
			billingProject = bp
		}

		res, err := sendRequest(config, "GET", billingProject, url, userAgent, nil)
		if err != nil {
			return nil, fmt.Errorf("Error reading AuthString: %s", err)
		}

		if err := d.Set("auth_string", res["authString"]); err != nil {
			return nil, fmt.Errorf("Error reading Instance: %s", err)
		}
	}
} else {
	if err := d.Set("auth_string", ""); err != nil {
		return nil, fmt.Errorf("Error reading Instance: %s", err)
	}
}

return res, nil